Search Results

Search: Posts Made By: vrms
8,376
Posted By vrms
Thanks vgersh99 that works very well thank...
Thanks vgersh99 that works very well

thank you

vrms:b:
8,376
Posted By vrms
OK I cant show a complete file (They are big!) ...
OK I cant show a complete file (They are big!)

So this is a section of one of the text files

-99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999...
8,376
Posted By vrms
replacing numbers greater than 0 with 1
I have some ASCII files containing numerous numbers. What I'd like to do is replace all numbers greater than 0 with 1.

Examples of the numbers include: - 000011 and 000042

Thanks
6,336
Posted By vrms
Finally got it working
Firstly thanks to everyone who posted on this thread.
I've finally got it working correctly!!

The code I used is as follows:

for file in $(ls -1)
do
newfile="$(echo $file | sed...
6,336
Posted By vrms
When I do the above on directory containing : ...
When I do the above on directory containing :

daf_2001-03_act.txt
daf_2001-04_act.txt

The content of the files are put on the screen as before.
When I do an ls I get the following files ...
6,336
Posted By vrms
When I run it sends the whole content of the...
When I run it sends the whole content of the files in the directory to the screen



[QUOTE]If the output is correct you can pipe the output of the sed command to sh to mv the files in the loop...
6,336
Posted By vrms
I'm afraid that hasn't had the desired effect...
I'm afraid that hasn't had the desired effect rana_d

But thanks for the suggestion

vrms
6,336
Posted By vrms
Hi guys the above script looks perfect (even to...
Hi guys the above script looks perfect (even to my untrained eye)

and the previous one

$ echo "daf_1961-04_act.txt"|sed 's/\(.*_\)\(.*\)-\(.*\)\(_.*\)/\1\3-\2\4/'
$ daf_04-1961_act.txt
...
6,336
Posted By vrms
Thanks guys this is great stuff!! However,...
Thanks guys this is great stuff!!

However, this might be me being very dumb, but is there a way of 'saving' this new file name to the original. And could this then be automated to do more than...
6,336
Posted By vrms
Thanks Nua7 What about rearranging the...
Thanks Nua7

What about rearranging the sequence of the file title = swapping the month and the year around. I was more concerned if that was possible.
6,336
Posted By vrms
file name transformation
I've got a multitude of text data files that carry exactly the same kind of data. Unfortunately some of them have a different filename format

some are: 'category'_'month'-'year'_act.txt

an...
2,855
Posted By vrms
oops sorry era I mean cheers
oops sorry

era I mean

cheers
2,855
Posted By vrms
worked a charm Thanks esa cheers
worked a charm

Thanks esa

cheers
4,097
Posted By vrms
Thanks for the Reply Jim Unfortunately this...
Thanks for the Reply Jim

Unfortunately this sends them all into one big tmp.file. I need to create a new text file for every single text file that is in the directory.
4,097
Posted By vrms
deleting lines from multiple text files
I have a directory full of text data files.

Unfortunately I need to get rid of the 7th and 8th line from them all so that I can input them into a GIS application.

I've used an awk script to do...
2,855
Posted By vrms
deleting specific lines from all files in a directory
I have a directory full of text data files.

Unfortunately I need to get rid of the 7th and 8th line from them all so that I can input them into a GIS application.

I've used an awk script to do...
Showing results 1 to 16 of 16

 
All times are GMT -4. The time now is 07:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy