I need to cut single record in the file(asdf) to multile records based on the number of bytes..(44 characters). So every record will have 44 characters. All the records should be in the same file..to each of these lines I need to add the folder(<date>) name.
I have a dir. in which there are subdirectories(the structure remains the same, I need to add the main directory name (example below) as a column in a fixed width file which is present in the subdirectory of that particular folder.. Can you please help me out in this as I am new to scripting.
Ex: /abc/<date>/def/asdf.dat
/abc/20010125/def/asdf.dat
/abc/20020502/def/asdf.dat
here I need to take the <date> dir name and put it in the asdf file after each row as a column.
Then conactenate all the data of the similar files into a single file.
Please help me out!
I need to do this for all the folders in 'abc'. the script needs go to all the sub folder of abc say <date> folder and to dir folder and pick up the file asdf. Split the long line by 44 char then add the <date> folder as a seperate column.
At last I need to add all the data from the different files into a single file.
The date folder is generic.. it changes but not the sub directories..
Thank you "ctsgnb" and "Morgan". the code is working with out the folder name..( if I remove /abc after find), but when i have the /abc it says directory does not exist.
This might be a silly question to U. can you please let me know why?
I can see that the folder exists..when I run the script on the folder above abc say (/root/abc/19990702/asdf.dat). I am running the command at /root. then its giving me the error. abc is not a mount point, i created this directory.. i actually replicated the actual scenario which i need to implement..