Search Results

Search: Posts Made By: kenneth.mcbride
1,168
Posted By kenneth.mcbride
I got it to work with mawk. mawk "{x[$1] =...
I got it to work with mawk.

mawk "{x[$1] = x[$1] ? x[$1]""\" \"$2 : $2} END {for(i in x) print i, x[i]}" example_01.txt

I introduced \" \" before the first $2

Thanks again for the starter...
1,168
Posted By kenneth.mcbride
Thanks Shamrock, I am not getting spaces...
Thanks Shamrock,

I am not getting spaces between all of the dates.
I get:

1001 2001_01_01
1002 2001_01_012002_02_02
1003 2001_01_012002_02_02
1004 2001_01_01
1005 2001_01_01
1006...
1,168
Posted By kenneth.mcbride
[SOLVED] re-parse duplicate horizontally
I have a 2 column file.
Column 1 is a road ID number.
Column 2 is the date that the road surface condition was inspected.
Some roads have been inspected only once, while some roads have been...
5
sed
1,492
Posted By kenneth.mcbride
Thanks for the pointer Jim got that part to...
Thanks for the pointer Jim

got that part to work on my file

example InFile:

OtherText
OtherText
ThatText
FollowedByThisText
OtherText
ThisText
OtherText
OtherText
ThisText
OtherText...
5
sed
1,492
Posted By kenneth.mcbride
sed
How do you instruct sed to perform edits starting at a user defined record?
1,186
Posted By kenneth.mcbride
multiple text edits inone pass
File_1 looks like:

bunch of text
Untitled Placemark
bunch of text
bunch of text
Untitled Placemark
bunch of text
bunch of text
Untitled Placemark
bunch of text

File_2 looks like:
...
5,624
Posted By kenneth.mcbride
.csv to Google Earth .kml
Does anyone have an awk script that converts/translates an ascii .csv file to a Google Earth .kml file?

The .csv would typically look like:
...
5,284
Posted By kenneth.mcbride
Print first, second, every nth, and last record
does anyone have an awk one-liner to:

print the first line, the second line, then every Nth line, and the last line of a file.

Thanks,
Kenny.
1,643
Posted By kenneth.mcbride
actually I have a constant word at the beginning...
actually I have a constant word at the beginning of each file name.
example: filename_
ls | sort -n is not working on my list of files.
I still get:
filename_1
filename_10
etc
instead of:...
1,643
Posted By kenneth.mcbride
numerically sorted filenames
How do you sort filenames: 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21
as:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
1,175
Posted By kenneth.mcbride
need an awk one liner
example input file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
3,251
Posted By kenneth.mcbride
Gentlemen, I thank you very much for your...
Gentlemen,

I thank you very much for your efforts in try to helping me with this code.

As I said, note that I am working in a Microsoft Windows XP command prompt window environment. Not sure if...
3,251
Posted By kenneth.mcbride
Jim, Thank you for your efforts in this...
Jim,

Thank you for your efforts in this matter.

I should add that my OS is Microsoft Windows XP.

Not sure if this will have any effect on your syntax.

I am actually using mawk.

I...
3,251
Posted By kenneth.mcbride
Thank you. Jim, {$1$2} was a typo. ...
Thank you.

Jim,

{$1$2} was a typo.

rdcwayx,

My files are not Latitude Longitude Degrees, but State Plane Feet.
They typically contain 3 million records.

A file looks like, PointNumber...
Forum: Open Source 09-17-2010
338,513
Posted By kenneth.mcbride
TextPad
TextPad
3,251
Posted By kenneth.mcbride
How to filter out almost dupicate X Y (Easting Northing) coordinates?
I have a large ascii file of 3+ million records.
The data type is easting northing elevation coordinates.
The file format is 3 fields, a numeric value for:
easting northing elevation

When I...
2,733
Posted By kenneth.mcbride
awk one liner
I need a one liner to"

find /pattern/

print from x lines before "pattern" to y lines after "pattern"
1,400
Posted By kenneth.mcbride
read from character 23 through character 32
I need a one-liner that will output characters 23 through 32 from a user defined record.

Thanks,
Kenny.
1,390
Posted By kenneth.mcbride
I need a special print
I have this:

\2009_may\05-04-2009\05-04-2009(74)
\2009_may\05-04-2009\05-04-2009(74)\05-04-2009(74)_0-999
\2009_may\05-04-2009\05-04-2009(74)_left...
2,105
Posted By kenneth.mcbride
make 1 new file using records of 5 input files
can you make me an awk script that will:

read the 1st record from each input file, file1 file2 file3 file4 and file5 and write them to file6.

then.....

read the 2nd record from each input...
2,519
Posted By kenneth.mcbride
mawk script to compare 2 files and report where they match
I have two files and would like a report of where they match.

Example of file1:

1 1 1
2 2 2
13 14 15
4 4 4
15 16 17
100 102 1004
56 57 890

Example of file2:

2 2 2
16 10 11
45 22...
2,896
Posted By kenneth.mcbride
add new lines of text before and after each input line
I have a file that contains hundreds of lines such as:

this_is_macro,000001
this_is_macro,000002
this_is_macro,000003

I would like to add the variable words

MACROBEGIN MACRO_000001...
6,535
Posted By kenneth.mcbride
repeat each record n times
I have:

aa01
aa02
aa03
aa04
ab01
ab02
ab03
ab04

I would like each record printed 5 times:

aa01
aa01
aa01
aa01
aa01
aa02
aa02
6,175
Posted By kenneth.mcbride
Thanks era, The fgrep doesn't produce the...
Thanks era,

The fgrep doesn't produce the desired result.
I think it might require the input files to be sorted first.

Your first sed code works.
In my example files you can see that file 2...
6,175
Posted By kenneth.mcbride
Use records from one file to delete records in another file
file_in_1:

1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
21 22 23 24
25 26 27 28
29 30 31 32

file_in_2:

9 10 11 12
21 22 23 24
1 2 3 4
17 18 19 20

file_out:
Showing results 1 to 25 of 32

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