Search Results

Search: Posts Made By: dcfargo
4,909
Posted By dcfargo
Golden - Thanks so much you rock!
Golden - Thanks so much you rock!
4,909
Posted By dcfargo
Actually string1 also contains a '/' character so...
Actually string1 also contains a '/' character so I need to figure out how to manage that as well.

I have a file like

Who what when
This is string/one today
string/one_is_here...
4,909
Posted By dcfargo
Extract lines between 2 strings add white space
I'm trying to extract all the lines between 2 strings (including the lines containing the strings)

To make the strings unique I need to include white space if possible. I'm not certain how to do...
2,929
Posted By dcfargo
Thanks so much - works great :b:
Thanks so much - works great :b:
2,929
Posted By dcfargo
count identical strings print last row and count
I have a sorted file like:

Apple 3
Apple 5
Apple 8
Banana 2
Banana 3
Grape 31
Orange 7
Orange 13

I'd like to search $1 and if $1 is not the same as $1 in the previous row print that row...
2,767
Posted By dcfargo
Thanks so much all it looks great. :b:
Thanks so much all it looks great. :b:
2,767
Posted By dcfargo
remove row if string is same as previous row
I have data like:

Blue Apple 6
Red Apple 7
Yellow Apple 8
Green Banana 2
Purple Banana 8
Orange Pear 11

What I want to do is if $2 in a row is the same as $2 in the previous row remove...
3,829
Posted By dcfargo
Thanks so much. That worked. :)
Thanks so much. That worked.

:)
3,829
Posted By dcfargo
print to more than one outfile AWK
I'd like to do an if / else if condition and print to different files.

Something like:

awk '{
if ($1 == "yes") print $2, $4 < infile > outfile1 ;
else if ($1 == "No") print $2, $4 <...
5,385
Posted By dcfargo
Oh I get it... awk '{ if...
Oh I get it...

awk '{ if toupper((substr($1,1,4)) == "ABCD") print $1 }' infile > outfile

Thanks you rule!!!
5,385
Posted By dcfargo
I'm not certain how that works. I'm new. I want...
I'm not certain how that works. I'm new. I want the outfile to retain the case that was in the infile as well.

Thanks again.
5,385
Posted By dcfargo
case-insensitive if on substring
I'd like to print a line if a substring is matched in a case insensitive manner

something like do a case insensitive search for ABCD as a substring:

awk '{ if (substr($1,1,4) ==...
2,355
Posted By dcfargo
search and replace characters in one string
I have lines like:

Dog Cat House Mouse
Dog Cat House Mouse
Dog Cat House Mouse
Dog Cat House Mouse

I'd like to replace characters only in $3.

H -> Z
s -> W
e -> x

Resulting in...
2,174
Posted By dcfargo
Wow thanks so much :b:
Wow thanks so much :b:
2,174
Posted By dcfargo
reverse a string based on else
I have a file like this:

Dog Cat One ABCDEFGHIJ house
Dog Cat Two ABCDEFGHIJ house
Cat Cat One ABCDEFGHIJ house
Cat Cat Two ABCDEFGHIJ house


I want to look at $3 and if it says "Two"...
2,358
Posted By dcfargo
print entire line after if lookup
I hope this is a basic question.

I have a file with a bunch of strings in each line (and the string number is variable).

What I want to do is a simple if command and then print the entire line....
2,641
Posted By dcfargo
Yeah AND && sorry. I'm really new.
Yeah AND && sorry. I'm really new.
2,641
Posted By dcfargo
comparing 2 columns from 2 files
Hey,

I have 2 files that have a name and then a number:

File 1:

dog 21
dog 24
cat 33
cat 27
dog 76
cat 65

File 2:

dog 109
dog 248
cat 323
cat 207
cat 66
11,442
Posted By dcfargo
Sort large file
I was wondering how sort works.

Does file size and time to sort increase geometrically?

I have a 5.3 billion line file I'd like to use with sort -u I'm wondering if that'll take forever because...
3,121
Posted By dcfargo
Thanks so much. That worked. :b::b::b:
Thanks so much. That worked. :b::b::b:
3,121
Posted By dcfargo
truncate/round down 2nd string print both
I have a file with a name and then a number:

Apple 1.1
Apple 1.5
Apple 1.9
Banana 1.3
Banana 2.7
Banana 3.3

I'd like to print out the first string followed by the second number rounded...
2,031
Posted By dcfargo
Thank you. Those pesky commas get me every time....
Thank you. Those pesky commas get me every time. :eek:
2,031
Posted By dcfargo
Split and print
I have a file with data such as:


X Y Z 4 1,3,5,7, 4,6,8,10,
A B C 3 2,3,4, 5,9,11,
E F G 5 1,2,3,4,5, 8,9,10,11,12,

Columns 1, 2 and 3 are descriptions. Column 4 tells how many numbers...
6,567
Posted By dcfargo
egrep from list in file
I'm sorry if this question has been answered already.

I have a file with a list of strings:

file_list:


I'd like to egrep another file (file_search) with each string on the list.

I'm not...
4,022
Posted By dcfargo
Sorry. You know what I did. I had the wrong...
Sorry. You know what I did. I had the wrong input file. Your code works great. I really appreciate all your help. My input file was start and the length of the string instead of start and the...
Showing results 1 to 25 of 53

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