Hi,
This is my first time on this forum..
I searched the previous answers, but didn't find the answer I was looking for at first glance.
csplit works beautifully for me, except for one thing. My file looks like this:
ad|name1|asdf...(several pages)..asdf ...
ad|name2|asdf...(several pages)..asdf ...
ad|name3|asdf...(several pages)..asdf ...
...x500 ...
where 'name x' is some regular string
With the command:
csplit file.txt '/ad/' {500}
I was able to split the file into 500 files, each starting with "ad|name1|..."
My only problem is that I want the NAMES of these files to be whatever's in the correspoinding vertical bars. In the above example, for file1, I want the name to be name1.
I have no clue how I would go about naming the children files according to what's in between the vertical bars [ I already know that the vertical bars will NOT show up anywhere else in the file ]. Is there a way using csplit ??
---------------
If csplit does not have this capability, I guess I'll have to just rename the 500 files. Is there a way to rename files based on what string is found between specified characters ??
I hope I don't have to do this manually.
Thank you everyone in advance! Any help is MUCH appreciated