All Questions
Tagged with text-processing files
222 questions
1
vote
3
answers
307
views
I know I can create folders from a list.txt, but can I move files to those folders based on a mapping?
If right now, I only had a bunch of files dumped into a single directory, is there a way that I could move the files into a folder based on a mapping file. For example:
A
B
1
File Name
Folder Name
2
...
0
votes
2
answers
679
views
Replace multiple lines and words using sed in a for loop
I have 2 files (mac and uid) with data on a Linux machine, that I want to carry to a "template", with a list, using sed to replace the data with variables.
list.txt:
CP00
CP01
mac.txt:
FF-...
0
votes
2
answers
152
views
How to remove the path in the column names from a text file in linux?
I have a tab-delimited text file data.txt that looks like the below:
# Program used for this
Geneid Chr Start End Strand Length /users/doc3/data/Q0062/input/HPR4/HPR4....
2
votes
4
answers
362
views
Count the occurrences comparing other file
I have two files:
F1.txt:
a:erwer|ee
b:eeeee|eee
c:ewrew|erwe
and F2.txt:
a.T1
a.T2
b.T3
C.T7
c.T4
I need to check the number of occurrences of the a,b,c keywords by checking F1.txt) from F2.txt.
...
2
votes
3
answers
1k
views
Create a new file with Names and path to the files in linux
I have several fastq.gz files, both R1 and R2 in a directory dir on a Linux system. It looks like:
dir
|____sampleA_1.fastq.gz
|____sampleA_2.fastq.gz
|____sampleB_1.fastq.gz
|____sampleB_2.fastq....
1
vote
5
answers
1k
views
Replace hyphen(s) with underscore(s) within angle brackets in a file
I’m aware of how to replace string;
e.g., replace hyphen with underscore in a file.
However, I wish to replace all hyphens with underscore
for all text that falls within angle brackets in a given file....
0
votes
2
answers
791
views
Renaming all files in the current directory to names listed in a text file
The original title was: Injecting vidir with vim like sequence of commands
I have been trying to use vidir to rename multiple files which are accidently renamed by someone.
Problem is vidir doesnt use ...
0
votes
1
answer
836
views
Only perform sed operations on lines starting with a particular string [closed]
I have the following file format
Received from +11231231234 at 2021-10-10T19:56:50-07:00:
This is a message that contains words like from, at, etc.
Sent to +11231231234 at 2021-10-11T06:50:57+00:00:
...
-2
votes
1
answer
172
views
Parse fixed width file and lookup those parsed values against Oracle Db
Files arrive within a specific time window (midnight-0600hrs EST) and get saved to the orders directory on the Linux host. these files are stored in a zip format. usually around 30 files are expected ...
0
votes
3
answers
80
views
find/detect file name goups
On fs i have files like:
PREFIX_GROUPNAME_OTHERNAMES[.txt|.*]
eg:
A_ABC_A.txt
A_ABC_B.txt
A_ABC_C.txt
A_XYZ_A.txt
A_XYZ_B.txt
A_XYZ_C.txt
For some futher tasks i want to get the group names.
$# ...
-1
votes
1
answer
2k
views
Check if there exists filename in directory
I have one file contains people name, like
Sam
Tom
Dad
Jack
I have one directory that contains name.txt or name.zip which file's form is not the same, like
Dad.txt
Tom.zip
Jack.zip
How to find sam ...
0
votes
2
answers
499
views
Search for string in most recent file in directory
I wanted to grep a string from the most recent file in the current directory. By using the following command I am able to fetch most recent file but, not able to grep in that file only.
$ ls -lrth
-...
0
votes
1
answer
617
views
Sed Bash script only runs first line of sed
My bash script only runs first line of sed. The command i use to run it:
sed -f sedhw.bash thesbians.txt
Contents of sedhw.bash
s/[0-9]*//g
s/1908/---/g; s/1895/---/g; s/1903/---/g
s/,.*//g
s/^[^&...
0
votes
3
answers
752
views
Split a row by a delimiter
I have a space-separated text file, e.g.
text1a text2a id1 text4a text5a
text1b text2b id2 text4b text5b
text1c text2c id3,id4 text4c text5c
text1d text2d id5,id6,id7 text4d,text4di text5d
The file ...
-2
votes
1
answer
103
views
List all of the files starting with sh, sr, se, th, tr or te
How can I list all of the files starting with the sequence sh, sr, se, th, tr or te (either letter could be upper or lowercase).