gringomike
Technical User
Hi all,
I have written a simple script which generates a text file in the following format;
name1
stuff1="blah-blah-blah
some_text
more_text
even_more
etc_etc"
stuff2="one_line
name2
stuff1="blah-blah-blah
some_text
more_text
even_more
etc_etc"
stuff2=one_line
name3
stuff1="blah-blah-blah
some_text
more_text
even_more
etc_etc"
stuff2=one_line
etc etc.....
I need the file to be in the following format;
NAME STUFF2 STUFF1
name1 one_line blah-blah-blah
some_text
more_text
even_more
etc_etc
name2 one_line blah-blah-blah
some_text
more_text
even_more
etc_etc
name3 one_line blah-blah-blah
some_text
more_text
even_more
etc_etc
I need to format this data (using HTML) into a table that can be uploaded onto our intranet.
I've had a look at Thread822-531443 but this doesn't give me the solution to my problem.
I'm aware that the solution is likely to be found using awk or sed however nothing I've tried so far has worked.
Does anybody know of a way to get the data into the necessary format?
My script currently reads as follows;
find /dir1 -name textfile > /path/to/file/find_output.txt
for FILE in `cat /path/to/file/find_output.txt`
do
ls -1 $FILE | awk -F/ '{print $3}' >> /path/to/file/a.txt
cat $FILE >> /path/to/file/a.txt
done
Thanks for your help in advance!
GM
I have written a simple script which generates a text file in the following format;
name1
stuff1="blah-blah-blah
some_text
more_text
even_more
etc_etc"
stuff2="one_line
name2
stuff1="blah-blah-blah
some_text
more_text
even_more
etc_etc"
stuff2=one_line
name3
stuff1="blah-blah-blah
some_text
more_text
even_more
etc_etc"
stuff2=one_line
etc etc.....
I need the file to be in the following format;
NAME STUFF2 STUFF1
name1 one_line blah-blah-blah
some_text
more_text
even_more
etc_etc
name2 one_line blah-blah-blah
some_text
more_text
even_more
etc_etc
name3 one_line blah-blah-blah
some_text
more_text
even_more
etc_etc
I need to format this data (using HTML) into a table that can be uploaded onto our intranet.
I've had a look at Thread822-531443 but this doesn't give me the solution to my problem.
I'm aware that the solution is likely to be found using awk or sed however nothing I've tried so far has worked.
Does anybody know of a way to get the data into the necessary format?
My script currently reads as follows;
find /dir1 -name textfile > /path/to/file/find_output.txt
for FILE in `cat /path/to/file/find_output.txt`
do
ls -1 $FILE | awk -F/ '{print $3}' >> /path/to/file/a.txt
cat $FILE >> /path/to/file/a.txt
done
Thanks for your help in advance!
GM