Search Results

Search: Posts Made By: dtdt
7,693
Posted By dtdt
thanks a lot.
thanks a lot.
7,693
Posted By dtdt
Sort unique by multiple fields
i need to sort to get all the unique records based on the 1st and 2nd column, and keep the record with the highest value on 5th column if there are duplicates, every column with varies length
...
2,120
Posted By dtdt
cat input.dat |tr -d '\n' | sed 's/000/000\n/g' >...
cat input.dat |tr -d '\n' | sed 's/000/000\n/g' > output_file
1,051
Posted By dtdt
Selected matching lines
two files: one with the line number only, and the 2nd one with line number and content, as following:

line_file.txt
1
3
5
9
23
30



content_file.txt
1|we are the world|good|great...
2,863
Posted By dtdt
only two files, tmp is not necessary ...
only two files, tmp is not necessary

keywords.txt
world
we
are
loop it

outfile.txt
we damn world|this is it, this is it. loop it.|
let's play|how about that?|
you are good, just loop...
2,863
Posted By dtdt
no good
no good
2,863
Posted By dtdt
anything not clear buddy?
anything not clear buddy?
2,863
Posted By dtdt
Find keywords, and append at the end of line
Task: Find keywords in each line, and append at the end of line; if not found in the line, do nothing.

the code is wrong. how to make it work. thanks a lot.

cat keywords.txt | while read line;...
1,649
Posted By dtdt
Thanks a lot. It works perfect. awk -F "|"...
Thanks a lot. It works perfect.

awk -F "|" '! a[$1]++' file
1,649
Posted By dtdt
Remove duplicates
I have a file with the following format:

fields seperated by "|"

title1|something class|long...content1|keys
title2|somhing class|log...content1|kes
title1|sothing class|lon...content1|kes...
2,963
Posted By dtdt
Works great! Thank you very much!
Works great! Thank you very much!
2,963
Posted By dtdt
i built a text file with pre-append string, and...
i built a text file with pre-append string, and file name as:

axxdfd, f1
bxdfsdffdsfsdfs, f2
....
xxxdfsfs, f3

cat flist.txt | while read line; do
pretext=`echo $line | cut -d',' -f1`
...
2,963
Posted By dtdt
i use a loop to bring in the pre-append variable
i use a loop to bring in the pre-append variable
2,963
Posted By dtdt
the original file contain quotes, not the...
the original file contain quotes, not the pre-append variable string.

ty
------------------------
the acutal problem is: I have a set of files, file_a, file_b... file_xx, all those files have...
2,963
Posted By dtdt
How to pre-append a variable string to each line in a file?
How to pre-append a variable string to each line in a file contains both single and double quotes?

The variable string has no quotes in it.

thank you very much.

:confused:
1,811
Posted By dtdt
Find missed numbers
I have a file as follows:

1
3
7
12
78
...
999998
1000000

I want to find out all numbers not in the file above and put into another file like

2
4
5
6
8
9
10
4,635
Posted By dtdt
Thanks a lot. I am testing it. ...
Thanks a lot. I am testing it.



---------- Post updated 07-17-12 at 02:38 PM ---------- Previous update was 07-16-12 at 09:30 PM ----------

it works! ty
4,635
Posted By dtdt
string replace in huge file
I need to parse a huge file... with some strings like this:

<li class="website-feature"><a href="http://some.changingurl.com" ..(some changing classes)..>

I need to change the above to:

<li...
8,778
Posted By dtdt
how to split a huge file by every 100 lines
into small files. i need to add a head.txt and tail.txt into small files at the begin and end, and give a name as q1.xml q2.xml q3.xml ....

thank you very much.
1,856
Posted By dtdt
i tried my sample file, not working. thanks...
i tried my sample file, not working. thanks verdepollo
1,856
Posted By dtdt
this is definitely now working. '021' is a...
this is definitely now working. '021' is a string, but all numbers.

---------- Post updated at 01:48 PM ---------- Previous update was at 01:39 PM ----------

i think i will just do sed...
1,856
Posted By dtdt
the result should look like "ABCD", "ACE",...
the result should look like

"ABCD", "ACE", "EDF", "021", "ABCD", 789, 23345, "ABCD", "DEF"

I think the question is how to replace only the first 5 , occurances to "," , then just replace "" to...
1,856
Posted By dtdt
replace string
I have a file almost sql ready, but some of the string are not in quotes. for example:

"ABCD", ACE, EDF, 021, ABCD, 789, 23345, "ABCD", "DEF"

my challenge is how to replace the first(1) , with...
3,110
Posted By dtdt
thanks man. how i forgot the =. ty
thanks man. how i forgot the =. ty
3,110
Posted By dtdt
come on. style=... is just an example. html style...
come on. style=... is just an example. html style formats can be really complicated. like <h1 align=center>headline 1</h1>
Showing results 1 to 25 of 33

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