Skip to main content

All Questions

0 votes
3 answers
66 views

Replace the trailing zero's of the date fields in the line

This is my input "004|B20A|2008-09-01 00:00:00.000|C|2008-09-01 00:00:00.070|4277" My output should be "004|B20A|2008-09-01 00:00:00.0|C|2008-09-01 00:00:00.07|4277"
Ganesh's user avatar
  • 1
0 votes
2 answers
2k views

How to extract the key words containing row from an excel file?

I need to extract the key-words containing row from an excel file (.xls) as per the order specified in the given key-word file. For example I have an excel file namely genome.xls as given below, ...
Kumar's user avatar
  • 129
0 votes
2 answers
98 views

How to remove repetition of the content of file by column?

I have a file containing the following content: WP_021815421.1 OG5_132922 deth|YP_182312 3 -07 42.35 81.7 WP_021815427.1 OG5_128110 rbal|NP_868155 1 -55 50.72 53.2 WP_012456834.1 ...
Mendel's user avatar
  • 3
0 votes
5 answers
810 views

How can I change the character of a string one by one?

I want to change all the characters in string one by one according to the substitution rule and save them to file on Linux. This is substitution file (sub.txt). A -> Y B -> V C -> Q ... ...
user2905046's user avatar
1 vote
2 answers
97 views

fastest way to subsitute on 10GB file for multiple expressions

I have a file of 10GB data, I want to execute 2048 substitution expressions of sed -i 's/pattern/replace_pattern/g' on that file. Is there a way to do it faster and effectively. Currently, I am ...
JigarGandhi's user avatar
  • 5,080
0 votes
2 answers
358 views

how to print the matching value from same line, which has multiple Delimiter?

I have a File under Linux /tmp/volume.log and the content is: [id:1091666, name:root, deviceName:/dev/sda, maxStorage:107374182400, unitNumber:0, displayOrder:0, rootVolume:true],[id:1091851, name:/...
user3179298's user avatar
2 votes
3 answers
141 views

how to remove syntax with uniq characters from line

we have the following configuration file, env.gc.txt export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:{{hbase_log_dir}}/gc.log-`date +'%Y%m%d%H%M'`" We try to ...
yael's user avatar
  • 13.9k
3 votes
2 answers
253 views

How to add properties in the end of the two first lines with double quote?

We want to add the following properties: -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M in the two first lines that contain the word - HBASE_MASTER_OPTS Example before ...
yael's user avatar
  • 13.9k
-1 votes
1 answer
102 views

How to delete from configuration file variable that not equal to 100

How to delete from configuration file the variable/s hadoop.tasklog.totalLogFileSize that are not equal to 100 example more file.conf hadoop.tasklog.totalLogFileSize=107 hadoop.tasklog....
yael's user avatar
  • 13.9k
4 votes
1 answer
3k views

How to insert file content after a certain string in a file? [duplicate]

we have for example this file cat exam.txt I am expert linux man what we can do for out country I love redhat machine "propertie" centos less then redhat fedore what my name is moon yea we want to ...
yael's user avatar
  • 13.9k
0 votes
2 answers
900 views

How to delete this string from a file using sed or perl?

I want to delete this string: no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"centos\" rather than the user \"root\".';echo;sleep 10" in below ...
Abhil lash's user avatar
2 votes
2 answers
157 views

Capture the words in double quotes

How to capture the words in the double quote to one line as out.txt more input.txt "OQ -63/ECC/UK/JDA/adRedprairie" "OQ -63/ECC/UK/JDA/adRedprairie.ear" "OQ- 63/ECC/UK/JDA/adRedprairie.xml" "OQ/CZ/...
yael's user avatar
  • 1,547
2 votes
2 answers
379 views

Only keep lines containing x or less number of numbers. TXT file

I found a similar question: How to delete line if longer than XY? But in this case I want to check not the total length, but the number of digits in the line. For example, out of this input: ...
silc's user avatar
  • 23
2 votes
6 answers
6k views

How do I remove a words ending in the letter S if duplicates without an S on the end are on the same list?

I have a large list of words. Many of the words are only different because they have the letter s on the end. If a word on the list is the exact same as another word on the list, except one of the ...
J363's user avatar
  • 500
0 votes
1 answer
1k views

How do I calculate the column percentage of a file?

I have a tsv file that contains some values. I want the sum of each column and total number of values and percentage values. Eg: file.tsv contains x 1 1 0 1 x x 1 x ...
Pradyumna Sagar's user avatar

15 30 50 per page