Hi
I was wondering if it's possible to use a command to get the first 3 characters of a line in a text file, I tried grep but it returns the whole line but I am only interested in the first 3 characters. Is this possible with grep or I need any other command?
Also is it possible deleting from... (2 Replies)
I'm looking to determine if I can use a grep command to read file and rename the file based on the first 3 characters of the data in the file.
An example is:
Read FileA
If the first 3 positions of the data in the file are "ITP", then rename the file as FileA_ITP, else if the first 3... (3 Replies)
hi
I copied a file to unix box from windows.
When i run this file it throws error on every command written in that file.
The reason is that the file contains some \r charecters that came into picture while copying the file.
This could be viewed by using od -c command.
My question is that... (2 Replies)
Hi guys,
Hope you are all well.
This is a line of data from a csv file. I have used vi and set the 'set list' option to display the trailing $ character.
"01","Grocery","01006","eat Fish & Spreads"$
I have tried the following commands, but neither of them appear to be working?
1) tr... (13 Replies)
Hi Experts,
I am working on HP-UX. I am new to shell scripting. I would like to have a shell script which will prefix:
1. "H|" before first row of my file and,
2. "T" for all other rows of the file.
For Example - File before running the script 20100430|4123451810|218.50|TC
20100430 ... (4 Replies)
Hello,
I tried with this command,it's working fine,file contains huge data it's not removing the control+M character
dos2unix test1.txt test2.txt
Please help me,is there any other option.
:wall:
Thanks,
Murali
---------- Post updated at 06:41 AM ---------- Previous update... (6 Replies)
sed -e "s// /g" old.txt > new.txt
While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
I need a scripting AWK to compare 2 files.
file 1 and 2 are list of keywords
1 is
a
b
c
d
2 is
aa
aaa
b
bb
ccc
d
I want the AWK script to give us the number of times every keyword in file 1 occurs in file 2.
output should be
a 2 (7 Replies)
I have a .CSV file when I check for the special characters in the file using the command cat -vet filename.csv, i get very lengthy lines with "^@", "^I^@" and "^@^M" characters in between each alphabet in all of the records. Using the code below file filename.csv I get the output as
I have a... (2 Replies)
I have this fastq file:
@M04961:22:000000000-B5VGJ:1:1101:9280:7106 1:N:0:86
GGGGGGGGGGGGCATGAAAACATACAAACCGTCTTTCCAGAAATTGTTCCAAGTATCGGCAACAGCTTTATCAATACCATGAAAAATATCAACCACACCA
+test-1
GGGGGGGGGGGGGGGGGCCGGGGGFF,EDFFGEDFG,@DGGCGGEGGG7DCGGGF68CGFFFGGGG@CGDGFFDFEFEFF:30CGAFFDFEFF8CAF;;8... (10 Replies)