10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to output all files that are made by this awk to a specific directory.
awk -F '' '{f = $3 ".txt"; print > f}' input.txt
Since the actual data has several hundred files I redirect the output (well tried to) to a directory.
awk -F '' '{f = $3 ".txt"; close($3 ".txt")} print >... (6 Replies)
Discussion started by: cmccabe
6 Replies
2. Shell Programming and Scripting
I am trying to split into different files using awk:
cat files | gawk '$1 ~ /---/ || $1 ~ /^deleting$/ || $1 ~ /^sorting$/ || $1 ~ /==/ {print}'| gawk '$1 ~ /---/ || $1 ~ /^deleting$/ || $1 ~ /^sorting$/ || $1 ~ /==/ {print}' |gawk '//{x="F"++i;}{print > x;}'
What I am trying to do is make F*... (3 Replies)
Discussion started by: newbie2010
3 Replies
3. Shell Programming and Scripting
so i have a file system:
/data/projects
in this file system, there's about 300 files. on all files in this directory, i'm running:
egrep -r 'Customer.*Processed' /data/projects/*
is there an efficient (fast) awk way of searching through each file in the directory and providing an... (9 Replies)
Discussion started by: SkySmart
9 Replies
4. Shell Programming and Scripting
Dear all,
I'm very new in scripting and using shell and prompt command.
I have a program (called fasta) and I need to iterate it over all files in a folder, but I'm not able to do that. Pratically the fasta program wants a sintax like this:
fasta.exe query_file.txt library_file.txt >... (2 Replies)
Discussion started by: gabrysfe
2 Replies
5. Shell Programming and Scripting
Hi,
I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files.
To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
Discussion started by: anandek
10 Replies
6. Shell Programming and Scripting
Hi,
I've recently started using Awk commands as i need it to pull information out of a file and give me the mean value of a series of numbers. Here is the code i run on my Infile and it works just fine.
awk '{if ($1 == "Mam189") print $0}' Infile | awk '{if ($1 != $2) print $0}' | awk... (5 Replies)
Discussion started by: cavanac2
5 Replies
7. Shell Programming and Scripting
Hello, I am working on a coding project for a class and to test the program I have created, I have come up with 100 different test cases. The program takes four text files as input, so each of the test cases is contained in a folder with four files.
I have a folder called 'tests', within which... (1 Reply)
Discussion started by: dpryor
1 Replies
8. Shell Programming and Scripting
Hi All,
I am using the awk command to replace ',' by '\t' (tabs) in a csv file. I would like to apply this to all .csv files in a directory and create .txt files with the tabs.
How would I do this in a script?
I have the following script called "csvtabs":
awk 'BEGIN {
FS... (4 Replies)
Discussion started by: ScKaSx
4 Replies
9. UNIX for Dummies Questions & Answers
I am wondering if anyone has any idea how to use an awk within awk to read files and find a match which adds to count.
Say I am searching how many times the word crap appears in each files within a directory. How would i do that from the command prompt ...
thanks (6 Replies)
Discussion started by: flevongo
6 Replies
10. Shell Programming and Scripting
Hi all,
I am working on a backup based script, in which it enters to a directory and check the sub-directories and copy the names into an array.
cd $CPFs
k=0
for i in *
do
if
then
ARRs="$i"
k=$(($k+1))
#echo "$i"
... (19 Replies)
Discussion started by: canishk
19 Replies