Sponsored Content
Top Forums Shell Programming and Scripting Create csv from four disparate files Post 303035226 by RudiC on Thursday 16th of May 2019 03:36:27 PM
Old 05-16-2019
Code:
for FN in *.out                                 # cycle through ALL *.out files (you could narrow it down somewhat by using *account.out)
  do    H=${FN%%.*}                             # use "parameter expansion" to remove everything beyond first
                                                #   dot (= beyond "host_n") and assign to H
        if [ ! "$H" = "$OH" ]                   # check if new host_n (different from old H)
          then  OH=$H                           # save new $H into old H, and
                {
                echo "host,accounts,max,pwd,standard"                   # print header
                echo $H | paste -d, - $H*.out | sed 's/, \+/,/'         # create csv fields / lines 

                } > $H.result                   # save all output to result file
        fi
  done

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare two csv files by two colums and create third file combining data from them.

I've got two large csv text table files with different number of columns each. I have to compare them based on first two columns and create resulting file that would in case of matched first two columns include all values from first one and all values (except first two colums) from second one. I... (5 Replies)
Discussion started by: agb2008
5 Replies

2. Shell Programming and Scripting

Merging files to create CSV file

Hi, I have different files of the same type, as: Time: 100 snr: 88 perf: 10 other: 222 Each of these files are created periodically. What I need to do is to merge all of them into one but having the following form: (2 Replies)
Discussion started by: Ravendark
2 Replies

3. Shell Programming and Scripting

How to create a CSV File by reading fields from separate files

SHELL SCRIPT Hi, I have 3 separate files within a folder. Every File contains data in a single column like File1 contains data mayank sushant dheeraj File2 contains DSA_AT MG_AT FLAT_09 File3 contains data 123123 232323 (2 Replies)
Discussion started by: mayanksargoch
2 Replies

4. Shell Programming and Scripting

Merge CSV files and create a column with the filename from the original file

Hello everyone!! I am not completely new to shell script but I havent been able to find the answer to my problem and I'm sure there are some smart brains here up for the challenge :D. I have several CSV files that I need to combine into one, but I also need to know where each row came from.... (7 Replies)
Discussion started by: fransanchezoria
7 Replies

5. UNIX for Dummies Questions & Answers

How to create a .csv file from 2 different .txt files?

Hi, I need to create a .csv file from information that i have in two different tab delimited .txt file. I just want to select some of the columns of each .txt file and paste them into a .cvs file. My files look like: File 1 transcript_id Seq. Description Seq. Length ... (2 Replies)
Discussion started by: alisrpp
2 Replies

6. Shell Programming and Scripting

Comparing Select Columns from two CSV files in UNIX and create a third file based on comparision

Hi , I want to compare first 3 columns of File A and File B and create a new file File C which will have all rows from File B and will include rows that are present in File A and not in File B based on First 3 column comparison. Thanks in advance for your help. File A A,B,C,45,46... (2 Replies)
Discussion started by: ady_koolz
2 Replies

7. Shell Programming and Scripting

How to create or convert to pdf files from csv files using shell script?

Hi, Can anyone help me how to convert a .csv file to a .pdf file using shell script Thanks (2 Replies)
Discussion started by: ssk250
2 Replies

8. Shell Programming and Scripting

Match columns from two csv files and update field in one of the csv file

Hi, I have a file of csv data, which looks like this: file1: 1AA,LGV_PONCEY_LES_ATHEE,1,\N,1,00020460E1,0,\N,\N,\N,\N,2,00.22335321,0.00466628 2BB,LES_POUGES_ASF,\N,200,200,00006298G1,0,\N,\N,\N,\N,1,00.30887539,0.00050312... (10 Replies)
Discussion started by: djoseph
10 Replies

9. Shell Programming and Scripting

Compare 2 files of csv file and match column data and create a new csv file of them

Hi, I am newbie in shell script. I need your help to solve my problem. Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file. File1: SourceFile,DateTimeOriginal /home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Discussion started by: refrain
8 Replies

10. Shell Programming and Scripting

Matching two fields in two csv files, create new file and append match

I am trying to parse two csv files and make a match in one column then print the entire file to a new file and append an additional column that gives description from the match to the new file. If a match is not made, I would like to add "NA" to the end of the file Command that Ive been using... (6 Replies)
Discussion started by: dis0wned
6 Replies
BOOBANK(1)						      General Commands Manual							BOOBANK(1)

NAME
boobank - Console application to list your bank accounts and other information SYNOPSIS
boobank [-dqv] [-b backends] [-cnfs] [command [arguments..]] boobank [--help] [--version] DESCRIPTION
Console application allowing to list your bank accounts and get their balance, display accounts history and coming bank operations, and transfer money from an account to another (if available). Supported websites: * bnporc (BNP Paribas French bank website) * boursorama (Boursorama French bank website) * bp (La Banque Postale French bank website) * cmb (Credit Mutuel de Bretagne French bank website) * cragr (Credit Agricole French bank website) * creditmutuel (Credit Mutuel French bank website) * fortuneo (Fortuneo French bank website) * hsbc (HSBC France bank website) * ing (ING Direct French bank website) * lcl (Le Credit Lyonnais French bank website) * societegenerale (Societe Generale French bank website) BOOBANK COMMANDS
coming ID Display future transactions. history ID Display history of transactions. list List accounts. transfer ACCOUNT [RECIPIENT AMOUNT [REASON]] Make a transfer beetwen two account - ACCOUNT the source account - RECIPIENT the recipient - AMOUNT amount to transfer - REASON reason of transfer If you give only the ACCOUNT parameter, it lists all the available recipients for this account. WEBOOB COMMANDS
backends [ACTION] [BACKEND_NAME]... Select used backends. ACTION is one of the following (default: list): * enable enable given backends * disable disable given backends * only enable given backends and disable the others * list list backends * add add a backend * register register a new account on a website * edit edit a backend * remove remove a backend * list-modules list modules cd [PATH] Follow a path. ".." is a special case and goes up one directory. "" is a special case and goes home. condition [EXPRESSION | off] If an argument is given, set the condition expression used to filter the results. If the "off" value is given, conditional filtering is disabled. If no argument is given, print the current condition expression. count [NUMBER | off] If an argument is given, set the maximum number of results fetched. NUMBER must be at least 1. "off" value disables counting, and allows infinite searches. If no argument is given, print the current count value. formatter [list | FORMATTER [COMMAND] | option OPTION_NAME [on | off]] If a FORMATTER is given, set the formatter to use. You can add a COMMAND to apply the formatter change only to a given command. If the argument is "list", print the available formatters. If the argument is "option", set the formatter options. Valid options are: header, keys. If on/off value is given, set the value of the option. If not, print the current value for the option. If no argument is given, print the current formatter. inspect BACKEND_NAME Display the HTML string of the current page of the specified backend's browser. If webkit_mechanize_browser Python module is installed, HTML is displayed in a WebKit GUI. logging [LEVEL] Set logging level. Availables: debug, info, warning, error. * quiet is an alias for error * default is an alias for warning ls [PATH] List objects in current path. If an argument is given, list the specified path. quit Quit the application. select [FIELD_NAME]... | "$direct" | "$full" If an argument is given, set the selected fields. $direct selects all fields loaded in one http request. $full selects all fields using as much http requests as necessary. If no argument is given, print the currently selected fields. OPTIONS
--version show program's version number and exit -h, --help show this help message and exit -b BACKENDS, --backends=BACKENDS what backend(s) to enable (comma separated) LOGGING OPTIONS
-d, --debug display debug messages -q, --quiet display only error messages -v, --verbose display info messages --logging-file=LOGGING_FILE file to save logs -a, --save-responses save every response RESULTS OPTIONS
-c CONDITION, --condition=CONDITION filter result items to display given a boolean expression -n COUNT, --count=COUNT get a maximum number of results (all backends merged) -s SELECT, --select=SELECT select result item keys to display (comma separated) FORMATTING OPTIONS
-f FORMATTER, --formatter=FORMATTER select output formatter (account_list, csv, htmltable, multiline, ops_list, pretty_qif, qif, recipient_list, simple, table, trans- fer, webkit) --no-header do not display header --no-keys do not display item keys -O OUTFILE, --outfile=OUTFILE file to export result COPYRIGHT
Copyright(C) 2010-2011 Romain Bignon, Christophe Benz For full COPYRIGHT see COPYING file with weboob package. FILES
"~/.config/weboob/backends" SEE ALSO
Home page: http://weboob.org/applications/boobank boobank 0.c 04 May 2012 BOOBANK(1)
All times are GMT -4. The time now is 12:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy