Search Results

Search: Posts Made By: Scottie1954
1,053
Posted By Scottie1954
Thank you all for your attemps to help, but I...
Thank you all for your attemps to help, but I give up. Clearly I haven't communicated what I need. I'll try another way.
1,053
Posted By Scottie1954
Let's look at field $1 in the sample file I...
Let's look at field $1 in the sample file I provided. The maximum number of digits in this field is 9, although many entries are less than nine digits, and some begin with one or more leading zeros. ...
1,053
Posted By Scottie1954
OK, fair enough that I am unfamiliar with the...
OK, fair enough that I am unfamiliar with the suggested output as scientific notation. But that's why I posted in this forum, and it's not helpful for me to have an answer that changes my number to...
1,053
Posted By Scottie1954
Thanks for the quick reply. Unfortunately this...
Thanks for the quick reply. Unfortunately this didn't work for all the records. Some entries in field 1 came out like this:

8.80674e+06, ,295 ,05/12/2014


I should have mentioned that I'm...
1,053
Posted By Scottie1954
Remove zeros from first field, but print all fields
Hello Everyone,

I've got a comma-delimited file that looks like this:
0012,123 ,456 ,05/12/2014
0123,525 ,286 ,05/12/2014
0456,791 ,300 ,05/12/2014
1095,759 ,300 ...
8,217
Posted By Scottie1954
Thanks, Jedi Master and Chubler_XL. Both answers...
Thanks, Jedi Master and Chubler_XL. Both answers worked.
8,217
Posted By Scottie1954
Thanks for your reply. What I want is an output...
Thanks for your reply. What I want is an output file that looks like this:
XXX,ABCD,123456,50,ZZ,5000,HI,EX
XXX,ABCD,223456,50,ZZ,5000,HI,EX
XXX,ABCD,323456,50,ZZ,5000,HI,EX

Instead I get an...
8,217
Posted By Scottie1954
How to read each line from input file, assign variables, and echo to output file?
I've got a file that looks like this (spaces before first entries intentional):
12345650-000005000GL140227 ANNUAL HELC FEE EN
22345650-000005000GL140227 ANNUAL HELC FEE EN
...
809
Posted By Scottie1954
Thanks again! I wasn't escaping the slash...
Thanks again! I wasn't escaping the slash properly. And I didn't know I could string two awk functions together with a ; so you've properly schooled me today.
809
Posted By Scottie1954
Thank you, Jedi Master. That worked perfectly....
Thank you, Jedi Master. That worked perfectly. And now if you will permit a follow up question, how would I strip the next field so it keeps only the name up to the / ?.

I want my output to look...
809
Posted By Scottie1954
Sure. Sorry for the lack of clarity. Here is what...
Sure. Sorry for the lack of clarity. Here is what I want the line to look like:
123456789,12,JOHN,DOE/JOHN H ,,,DOE/JOHN H ,,,,,123 FAKE STREET ,SPRINGFIELD,XX,

Thanks!
809
Posted By Scottie1954
Find and delete part of field with awk or sed
I've got a file that looks like this (the whitespace between commas is intentional):

123456789,12,JOHN H DOE ,DOE/JOHN H ,,,DOE/JOHN H ,,,,,123 FAKE STREET ...
762
Posted By Scottie1954
Yes! That's it. Unfortunately, the column value I...
Yes! That's it. Unfortunately, the column value I want isn't always the $3 field when the name has a middle initial. James T Kirk, for example, puts the value I want in $5.

Thank you!
762
Posted By Scottie1954
awk help: how to pull phrase and one column from line above?
Hi everyone,

Here's my awk statement so far: awk '/TOTAL TYPE:/{print x;print};{x=$0}' file1 >file2

'file1' has too much proprietary data in it to include here, so let's go with the output...
670
Posted By Scottie1954
Yeah, I've been a bit cryptic with what's in the...
Yeah, I've been a bit cryptic with what's in the file as it has mostly confidential data. It would take some effort to redact. Anyway, I've tried both replies here with no luck. The sed suggestion...
670
Posted By Scottie1954
How to find a phrase and pull all lines that follow until the phrase occurs again?
I want to burst a report by using the page number value in the report header. Each section starts with *PAGE NO:* 1 Each section might have several pages, but the next section always starts back at...
2,427
Posted By Scottie1954
Thanks for all the replies and different...
Thanks for all the replies and different solutions.
2,427
Posted By Scottie1954
That worked nicely. But how does the $4 in the...
That worked nicely. But how does the $4 in the last argument pull the correct value? I thought awk needed spaces between fields. Thank you!
2,427
Posted By Scottie1954
How do I pull the value between curly braces?
Hi everyone,

I've got a file that looks like this:
uid{508}pid{22224}pname{/PPROGRAM/pprgramx -profile:LIVE -serv:as ...

I want to pull the value of pid between the curly braces, or 22224 in...
2,648
Posted By Scottie1954
Does 'grep' update a file's access date/time?
I've got a job that finds and removes trace files based upon an access time of more than seven days (I've also tried a modify date).

find TABC*[0-9][0-9] -atime +7 -exec rm +
find...
1,748
Posted By Scottie1954
Thanks to all who replied. The reason sdiff...
Thanks to all who replied. The reason sdiff wouldn't work is because the bigger file had many more 16-digit entries in between the matches in the smaller file, so a line-to-line comparison between...
1,748
Posted By Scottie1954
Yes, I have awk. GNU utilities like nawk or gawk...
Yes, I have awk. GNU utilities like nawk or gawk aren't installed on my OS. Thank you.
1,748
Posted By Scottie1954
These are 16 digit numbers, sorted numerically: ...
These are 16 digit numbers, sorted numerically:



123456000017214
123456000017255
123456000018300
123456000100123
123456000100253
223456000001212
223456000013212
1,748
Posted By Scottie1954
Find common numbers from two very large files using awk or the like
I've got two files that each contain a 16-digit number in positions 1-16. The first file has 63,120 entries all sorted numerically. The second file has 142,479 entries, also sorted numerically.
...
9,102
Posted By Scottie1954
Shoot, why didn't I think of that?! Worked like a...
Shoot, why didn't I think of that?! Worked like a magic spell. Looks like I need to learn more about the Output Field Separator. Thank you!
Showing results 1 to 25 of 43

 

Featured Tech Videos

All times are GMT -4. The time now is 05:59 PM.
Unix & Linux Forums Content Copyright 1993-2019. All Rights Reserved.
Privacy Policy