Eureka
It mean's that i don't have to work on weekends and that i don't have to wakeup on 3.00AM to come to work on weekdays.
It's frequent the problems with that printer, and this will able them to repeat what they need without help.
Thank you very much once again, Ygor.
Hi there
i'm using this script from Ygor ,where i have made a small change to adapt it to my needs.
It just happens that i'm trying (not very successfuly) to change it a bit.
Right now i have a file , that the script loads 48 lines each time into an array and look for a match on the 6th entry, then prints those 48 lines where the match is found and print the next "xx" lines i indicate to the script.
here it is:
this works wonderfuly.
My problem now, is that some times the user don't know how many more pages in the file he has to print. What he allways know is the first page and last page to repeat.
So, i need to change the script indicating not HOW MANY PAGES MORE, but a second match to be found in the file and then print from the 48 lines where the first match is found to the 48 lines where the second match is found.
awk -v cid="$clientID" -v eid="$endingID" '
{
if (NR%48==6 && $0~cid) {
for(x=NR-5;x<NR;x++)
print a[x%5]
cnt=1000000
}
if (NR%48==6 && $0~eid) cnt=40 --------------------- this should be 43 in my understanding, otherwise it will make the last page 3 lines short
a[NR%5]=$0
}
cnt-->0' /usr/imp/$sFile > /usr/imp/rep.txt
thanks Ygor, i've been learning a lot with you. Thanks for that
OS version: RHEL 6.7
Shell : Bash
I have a file like below. It has 500K lines.
I want to extract TAG_IDs shown in single quote at the end to copied to another file. As if I had copied the TAG_IDs using block select (Column Select) in modern text editor
$ cat file.txt
UPDATE TAGREF SET... (9 Replies)
Hello
I would like to get know how to do this:
I got a big file (about 1GB) and I need to find a string (for instance by grep )
and then find all records in this file based on a string.
Thanks for advice.
Martin (12 Replies)
Hi All,
I am new to shell srcipting.
Problem :
I need to write a script which copy the log files from /prod/logs directory based on todays date like (Jul 17) and place it to /home/hzjnr0 directory and then search the copied logfiles for the string "@ending successfully on Thu Jul 17". If... (2 Replies)
I am new, really new to bash scripts.
I want to search an XML file for a certain string, say "1234567890"
Once found, I want to copy the entire contents from the previous instance of the string "Entity" to the next instance of "/Entity" to a txt file.
And then continue searching for the... (4 Replies)
Hi all,
I have a question..
Here is my requirement..I have 500 files in a path say /a/b/c
I have some numbers in a file which are comma seperated...and I wanted to check if the numbers are present in the FileName in the path /a/b/c..if the number is there in the file that is fine..but if... (1 Reply)
i have a file1 with many lines. i have a script that will let me input a string. for example, APPLE. what i need to do is to copy all lines from file1 where i can find APPLE or any string that i specify and paste in on file 2
thanks in advance! (4 Replies)
Hi! just want to seek help on this:
i have a file wherein i want to find a string and copy the string after that and paste that other string to a new file.
ex:
TOTAL 123456
find "TOTAL" and copy "123456"
and paste "123456" to a new file
NOTE: there are many "TOTAL" strings on that... (12 Replies)
I'm trying to copy a string (myame@yahoo.com) from multiple files and save them to a new file.
This is what's I've gathered so far:
sed 's/string/g' file.txt > output.txt
Not sure how to run this on multiple files and extract just the email address found in each file.
Any help would be... (2 Replies)
I am using the following command to email a tex file as an attachment-
cat mailtext.txt | elm -s "Subject" emailAddr
where content of mailtext.txt is -
"Body of email"
This will attach foo.txt with the email.
My problem is that the file foo.txt is ceated dynamically everytime with a... (5 Replies)
I am trying to search for files and copy them into a text file. Can anybody help me how to do that.
find /test/sds/data -name "*.*" -mtime -365 -exec ls -altr {} \
this is my find command and want to copy the result to a file. (2 Replies)