form template - or I don't know how to define it

Just starting out? Need help? Post your questions and find answers here.
miskox
User
User
Posts: 95
Joined: Sun Aug 27, 2017 7:37 pm
Location: Slovenia

form template - or I don't know how to define it

Post by miskox »

I have a source CSV (semi colon delimited ";") .txt file with 13 fields (for this question).

Code: Select all

sf_0;sf_1;sf_2;sf_3;sf_4;sf_5;sf_6;sf_7;sf_8;sf_9;sf_10;sf_11;sf_12;
I want to write an app to read this source file and make a new file which has 8 fields (semicolon delimited). I want to have a way of dynamically select which fields from source file I want in the output file. I would also like to have some special options (for example an option to replace a string in a source field with something else if required).

So I would need an .ini (or whatever it is named) file with something like this:

Code: Select all

field7=<source_field4> <source_field3>
field6=<source_field2>
field5=<source_field5>Some text that would be added here and written to output file
field4=<source_field6>
field3=<source_field7>
field2=<source_field8><[,0;X]>
field1=<source_field9> <source_field_12>
field0=<source_field10>
Output field7 would have an output field as values of both source fields 4 and 3 with added space.
Output field5 would have text "Some..." added after the value of the field 5.
In the field2 there is

Code: Select all

[,0;X]
This would mean: replace ",0" with "X".
etc.

I don't know what to search for on the internet. I need some kind of 'special keywords'.

Something like macros are designed/built?

Ideas?

So if there is a better name to name this topic - please help.

Thanks.
Saso