text file into excel

ganutenator

Lifetime Supporting Member
Join Date
May 2002
Location
kansas
Posts
1,440
I wrote a script in Indusoft that backs up recipes to a text file.
I would like to allow the customer to view these in excel.
 
Uhh, right on...

I guess since you didn't really give many specifics, nor did you ask an actual question, I'll just say copy and paste the data in your text file into excel.
 
You don't even need to use csv as long as the formatting is done consistently.

In Excel, go to Data tab, In the Get External Data section, you can choose from text, point to the file and define how the file is formatted for it to be able to split the data into cells.
 
Last edited:
I've done this exact procedure with Indusoft Web Studio. The issue is that in a recipe data file Indusoft stores arrays of tags that are strings with a space between them and arrays of numbers with linefeeds. If the recipe doesn't have arrays than every line is a separate tag.

So the attached macro for excel in a text file works on four arrays, the first two are strings, the second two are numbers.

The recipe is loading arrays that contain 300 tags.

2018-01-23_15-34-10.jpg
 

Attachments

  • macro.txt
    1.2 KB · Views: 16
  • Calcs.rcp.txt
    266 bytes · Views: 13
Crud, I screwed that post up, code is good but that 'makes' a recipe from an Excel worksheet. And you said you wanted to Read a recipe.

Hopefully this excel file clears it it up, it does both write and read. (100 elements in these arrays)
 
the indusoft saves data values to a text file. here a snipet of what the text file looks like:

I would like to allow the customer to view this as in a format that makes more sense to them.
Thinking of maybe using the vb in excel to read the lines of the text file and put them in the proper cells? but I don't know how to do that at the moment.

[Speed Config]
Pre1WashPassSpd=1.35
Pre1SlowFrntSpd=0.80
Pre1SlowRearSpd=0.80
Pre2WashPassSpd=1.35
Pre2SlowFrntSpd=0.80
Pre2SlowRearSpd=0.80
HiPressWashPassSpd=1.25
HiPressSlowWashPassSpd=0.70
HiPressSlowFrntSpd=0.70
HiPressSlowRearSpd=0.70
TriFoamWashPassSpd=1.50
LpChem3PassSpd=1.25
FoamWaterfallPassSpd=1.30
PresoakDwellPassSpd=1.50
RepositionPassSpd_hmi=1.57
MedPressPassSpd=1.57
SpotFreeWashPassSpd=1.25
TopMedPressPmpSpd=30
SideMedPressPmpSpd=30
SideHighPressNormalPmpSpd=48
SideHighPressTallPmpSpd=60
UnderbodyPmpSpd=30
 
Does Indusoft gives you the option of saving as a .csv file or are you limited to .txt?
A .csv file is also a text file that Excel can open.
If Indusoft won't let you save as .csv, I suggest you create an Excel spreadsheet that displays the data the way you want and then save it as a .csv file. Open the .csv file with Notepad to see how the tagnames and values are arranged. Then modify your Indusoft script to create a file that matches the way the data is presented in the .csv file.
 
I want excel to read the file, look for ex: "Pre1WashPassSpd" and put it's value in a cell that I made pretty for the customer to see. aka, not display the tag name but something like Easy cleaning: Presoak 1 Wash Pass Speed 1.35 ft/sec. automatically.
 

Similar Topics

I need to import tag file from Text file or excel file into Unity Pro:huh:
Replies
2
Views
3,603
I am currently working on a project where i need to save the online DB values to a .CSV or text file. This has to be done at say an interval of...
Replies
1
Views
5,103
I Have an Excel file with 200 rows. The first column has the Item Number and the second column has the Description. I need to do a lookup based...
Replies
3
Views
4,042
Hello. I have a problem which may be common in this part of the world. My CoDeSys program reads data from a text file that I generate from the...
Replies
10
Views
2,390
Structured Text does not have FLL instruction, but one can create the equivalent. SIZE(destination,0,length); FOR position := 0 TO length-1 DO...
Replies
5
Views
2,548
Back
Top Bottom