w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » CSV » Page 1
AWK Split large CSV file with headers and print output files based on column value
You can simplify the awk as awk -F; '{print > $3".csv"}' input Will produce the following csv files with content 26.csv 10003062;19.99;26;http://testdata.com/bla/29002816.jpg;5.95;17012725049 10048375;26.99;26;http://testdata.com/bla/29002270.jpg;5.95;95082912275 48.csv 10002394;22.98;48;http://testdata.com/bla/29012827.jpg;5.95;93962094820 10004766;12.99;48;http://testdata.com/bla/29007085

Categories : Csv

Tab Delimites to CSV
Download python: https://www.python.org/downloads/ Install it. And run a script similar to the following. Save the following as convert_tsv_to_csv.py Or anything ending in .py: import csv with open('C:\path ofile','r') as f: tab_file = csv.reader(f, dialect=csv.excel_tab) with open('C:path ooutfile.csv','w') as g: comma_file = csv.writer(g, dialect=csv.excel) for row in tab_file:

Categories : Csv

Adding a column (first column) to csv file with service names and the status
Capture the IP address first, and give the value to awk ip=$( ifconfig | sed -En 's/127.0.0.1//;s/.inet (addr:)?(([0-9].){3}[0-9])./2/p' ) service --status-all | awk -v ip="$ip" -v OFS="," '/running|stopped/ {print ip, $1, $NF}' >> "$HOME/MyLog/running_services_$HOSTNAME.csv" Note that you don't need grep: awk can do that job.

Categories : Csv

Parse tab separated text file in Google Sheets
It turns out that IMPORTDATA(url) can import a tab separated file, but it expects the file name to have the .tsv extension. This is inconsistent with Excel, where a tab-separated export results in *.txt. If you can ensure that you use a .tsv extension, then your problem is solved. You can also use the Sheets UI to import the file (into a new Spreadsheet). Select File > Import..., then Upload

Categories : Csv

Use Google Script to download a file to Google Drive
Here's a little snippet that will help. function saveFile() { var url = "http://www.ferc.gov/docs-filing/eqr/soft-tools/sample-csv/contract.txt"; var blob = UrlFetchApp.fetch(url).getBlob(); DriveApp.createFile(blob); }

Categories : Csv

CSV data set config in jmeter options
Your CSV file can have the details like mentioned below: username1, password1, templeteid1 username2, password2, templeteid2 username3, password3, templeteid1 username4, password4, templeteid2 In your CSV Data Set Config, you can set variable names as mentioned below: username,password,templeteid In this way each user will select different template. hope this will help.

Categories : Csv

How to write groups of data in CSV file?
csv_writer.writerows expects a list of lists, you gave it a string, which is a list of characters. Try this: csv_writer.writerow(["cluster %d:" % y] + cat[i] for i in c)

Categories : Csv

Julia: How to import a graph from text file (csv with unequal number of 'columns')?
I don't think readdlm is right for this data, its just inherently not tabular. My approach, which I believe is fairly minimal in memory usage, would be f = open("graph.csv","r") adjlist = while !eof(f) push!(adjlist, map(int, split(chomp(readline(f)),","))) end close(f) which produces julia> adjlist 3-element Array{Array{Int64,1},1}: [1,6,7,3] [2,5] [3,9,8]

Categories : Csv

undefined method `path' csv.read
That's because depending on the size of the CSV file you're trying to upload, the type of file might either be a StringIO or TempFile object. So you may wan to take appropriate action, depending on which it is. See this answer for an explanation. Following that your code becomes something like: file_data = params[:file] if file.respond_to?(:read) csv_text = file.read elsif file.respond_to?(:pat

Categories : Csv

CSV rendering of page doesn't handle newline character within same field
CSV output for XML Screen is done with the DefaultScreenMacros.csv.ftl file. There is a macro at the top of the file called csvValue that does the minimal encoding. More could certainly be done there, to match whatever the parser you are using will work with.

Categories : Csv

Add elements to a sequence
Sequences in F# are immutable, so you can't just insert data into them. If your data set isn't too big, the easiest solution may simply be to add the new data to the head of a list, and then sort it: > let data = [("Din", "Anh" , 69); ("James", "Urbank", 61)];; val data : (string * string * int) list = [("Din", "Anh", 69); ("James", "Urbank", 61)] > ("Ernest", "Cuban", 70) :: data |>

Categories : Csv

np.savetxt style nicely tabulated output for pandas DataFrame.to_csv
Here's a silly trick: use ASCII BEL (bell) as your quote character. At least on my system this prints no quotes at all: result.to_csv(float_format='%10.2g', sep=' ', index=False, quotechar='a') Or use a dummy character and replace it at the end: ss = result.to_csv(float_format='%10.2g', sep=' ', index=False, quotechar='^') print ss.replace('^', '')

Categories : Csv

AWK, SED to format txt as CSV when input file may change
That worked for me: awk '$1=="DEV#:"{nr=$2; dn=$5; ty=$8; pol=$10} $1=="SERIAL:"{sn=$2} $1~/[0-9]/{printf "DEV#: %s DEVICE NAME: %s %s TYPE: %s POLICY: %s;SERIAL: %s;%s;%s %s %s %s;%s;%s;%s;%s ", nr, dn, $5, ty, pol, sn, $1, $2, $3, $4, $5, $6, $7, $8, $9}' file Explanation: $1=="DEV#:{...}: if the first field is DEV#:, set the variables nr, dn, ty and pol $1=="SERIAL:{...}": if the fi

Categories : Csv

How to ignore timezone in csv data
You can use gnuplot's string functions to remove the time zone part from the data. In this case you don't need to use set timefmt, but the time values are parsed inside the using statement with strptime. set datafile separator ',' set xdata time fmt = "%Y-%m-%dT%H:%M:%S" timeval(s) = strptime(fmt, substr(s, 0, strstrt(s, '+')-1)) plot 'data.csv' using 1:(timeval(strcol(2)))

Categories : Csv

Classic ASP export to CSV generates blank 1st row
Bit of a guess here, but try having your vbs in a single block of code and use vbcrlf to add line breaks where you need them - ie <% Con.open DSNtest set rec1=con.execute ("SELECT * FROM orders where receivedp = '0000-00-00 00:00:00' AND pid = '" & struserid & "' order by zipid asc") Response.write "sep=;" & vbcrlf Response.write "Address;City;State;Zip;" & vbcrlf while not rec

Categories : Csv

Neo4j flexible batch importer using Groovy
In Groovy, the @Grab annotation checks if the dependencies can be resolved locally. If not it will hit a Maven repository to download. My suspicion is that your machine does not have proper internet access. Maybe you have to configure a proxy, see http://groovy.codehaus.org/Grape for details.

Categories : Csv

Importing Prestashop products with translations
I'll answer myself then. When importing the csv, maek sure the ID override and Refrence # is turned on Import all the data with your main language in use. Import the translated data, make sure the ID's and Reference # match. Import only the stuff you need. For a translation, you'd only need to import the title, description and translations of features. Everything else will come from the main lan

Categories : Csv

concatinating .csv files column wise
Ideally, you could use the unix "paste" command to do this. With Windows SUA installed, you can use paste. However, I gave it a try and as it's still unix based it doesn't like CRs in files. i.e. Unix uses LF only, Windows uses CRLF and paste will keep the CRs so you end up with carriage returns mid lines. Writing a paste.exe to do this really wouldn't take much effort, I'm sure someone must have

Categories : Csv

conversion error from csv to javaRDD
Spark uses pretty old guava version (14.0.1) and look like one of your dependencies bring newer incompatible version. Try to fix guava version to version of spark. Also this one may be interested - http://apache-spark-user-list.1001560.n3.nabble.com/Is-Spark-1-1-0-incompatible-with-Hive-td17364.html

Categories : Csv

How to get register through unique Email ID in JMeter
Do you have proper correlation logic in place? ASP.NET web applications use at lease VIEWSTATE page level state management mechanism which holds current state of things on client side and needs to be updated each subsequent request. It is usually looks like __VIEWSTATE hidden input, you need to extract it from previous response and add as a parameter to next request elsewise you'll be sitting on t

Categories : Csv

JMeter save results in csv file
In the "jp@gc - PerfMon Metrics Collector" plugin, provide Filepath & FileName in "Write results to file/Read from file" section. Note: Every time before running the test change the filename, in order to keep separate files for separate tests. Hope this will help.

Categories : Csv

How to distribute different threads to access different links in JMeter
Create two thread groups.Each with three users for registration and login respectively.By default jmeter will run it concurrently.If you dont want it to run concurrently and want it to run consecutively,click on the 'Run thread groups consecutively checkbox' in the Test plan's root page

Categories : Csv

Loading data in Neo4j from csv
You can use toInt(csvline.id) for e.g. : http://neo4j.com/docs/stable/query-functions-scalar.html#functions-toint

Categories : Csv

AWK SED Manipulate text to sort it as CSV
sed -nE 's/^Share name *(\\.*)/1;/p;s/^Path *(.*)$/1;/p;s/^WINDOM.*/&;/p' input.txt | tr -d " " | sed 's/;\\/; \\/g' | sed 's/;$//' Output: \SERVERC1uh4;C:volCN_FS4CN_QT01FILESERVER43userhome;WINDOMNASCIFSMIG01: FULL CONTROL;WINDOMADMINDA14b : FULL CONTROL;WINDOMADMINDA16 : FULL CONTROL \SERVERC1uh5;C:volCN_FS2CN_QT01FILESERVER01userhome;WINDOMNASCIFSMIG01: FULL CONTROL;WINDOMADMIND

Categories : Csv

gatling and csv ( fetching data from csv)
You use RawFileBody, which, has the name states, treat the files as raw content, not templates. Please read the documentation and use the suited Body type, which is ELFileBody.

Categories : Csv

jmeter CSV stops sample error
You have met one of the conditions that causes the while loop to stop (condition is blank): From help: The While Controller runs its children until the condition is "false". Possible condition values: blank - exit loop when last sample in loop fails LAST - exit loop when last sample in loop fails. If the last sample just before the loop failed, don't enter loop. Otherwise

Categories : Csv

Why 'CSV' is most preferable in ruby on rails
CSV is a simple text format, and readily parsed, whereas XLS is a proprietary binary format. Why put your code through loops to load, open and iterate Excel data structures when you can simply process a text file for the same end?

Categories : Csv

Replace string in multiple columns in a csv
Using awk awk 'BEGIN{FS=OFS="|"}{sub(20141030,"20141029",$4); sub(20141030,"20141029",$5); print}' inputFile Gives output as BRANCH|TXN_ID|CUSTOMER|PROCESS_DATE|VALUE_DATE|AMOUNT|UPLOAD_DATE|NARRATIVE 1|23234|12343|20141029|20141029|2000|20141030|TEST 1|23234|12343|20141029|20141029|2000|20141030|TEST 1|23234|12343|20141029|20141029|2000|20141030|TEST 1|23234|12343|20141029|20141029|2000|20141

Categories : Csv

neo4j batchimporter is slow with big IDs
I think the problem is that the batch importer is interpreting those IDs as actual physical ids on disk. And so the time is spent in the file system, inflating the store files up to the size where they can fit those high ids. The ids that you're giving are intended to be "internal" to the batch import, or? Although I'm not sure how to tell the batch importer that is the case. @michael-hunger any

Categories : Csv

Jmeter CSV issue
A key point to focus on is the way your application manage the case when 2 different users require the same page. There are few checks that I would recommend: be sure that the "Recycle on EOF" property is true be sure that you have more lines on CSV than the number of threads you are firing use a "View result tree" controller to investigate the kind of error you are getting Let us know

Categories : Csv

Neo4j creating relationships using csv
Be sure to have schema indexes in place to speed up looking up start nodes. Before running the import do a: CREATE INDEX ON :Movie(title) CREATE INDEX ON :Keyword(word) Make sure the indexes are populated and online (check with :schema command). Refactor your Cypher command into two queries, to make use of the indexes - for now a index consists only of a label and one property: USING PERIODIC

Categories : Csv

Pentaho Data Integration - How to loop csv file column and each column will create a table
First of all, you need to use Header Row Present in CSV File Input step. Now, your first row contains all names you need. To get first row only, you could use Sample Rows step to get it (just provide line number threr). Now you somehow need to split row with three values into three rows. You could first use Concat fields step and then Split fields to rows step. Now, you have three rows with you

Categories : Csv

Proc IMPORT - csv files - avoid variables names as VARx
As mentioned in the SAS documentation (e.g. http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000312413.htm) If the column names in the first record in the input file are not valid SAS names, then the IMPORT procedure uses default variable names.

Categories : Csv

Writing Chinese characters to csv from peoplecode peoplesoft
The problem appears to be that you are not writing the same character set that your recipient is opening the file with. Since you are using UTF8, your choice does support the Chinese characters. I see you have a couple options: Find out the character set your recipient is using and use that character set when writing the file. Educate the recipient that the file is in UTF8 and that they may ne

Categories : Csv

Remove duplicate lines but keep the one that does not have a string
In the general (unsorted) case if you want to keep the last entry of a line by field you can use something like: awk '{seen[$1]=$0} END {for (i in seen) {print seen[i]}}' file Though that isn't guaranteed to keep sort order. In this case, with sorted input something like this should work: awk 'f!=$1 && line{print line} {f=$1; line=$0} END {print line}' file

Categories : Csv

Jaspersoft Studio : issues while drawing graph
I have created two variables which I am gonna use in my pie chart to select the Top N Values from the Dataset. To achieve This I have used $V{REPORT_COUNT} Variable as follows IF($V{REPORT_COUNT}<=N,$F{Your_Field},"") - If the Variable is a String IF($V{REPORT_COUNT}<=N,$F{Your_Variable},0) - If the Variable is Integer. Substitute N with your desired number.If you need top 10 values then N

Categories : Csv

Create String from CSV Lookup with AppleScript
Try this... set myOrg to "Org1" set otherPeople to "" set csv to "Org1,Bobby Bob,bobbybob@gmail.com Org1,Wendy Wen,wendywen@gmail.com Org1,Rachel Rach,rachelrach@gmail.com Org2,Timmy Tim,ttim@otheremail.com Org2,Ronny Ron,rron@otheremail.com Org2,Mike Mik,mmik@otheremail.com" set text item delimiters to "," repeat with aLine in paragraphs of csv set textItems to text items of aLine if i

Categories : Csv

How to convert sas7bdat file to csv?
Use one of the R foreign packages to read the file and then convert to CSV with that tool. http://cran.r-project.org/doc/manuals/R-data.pdf Pg 12 Using the SAS7BDAT package instead. It appears to ignore custom formatted, reading the underlying data. In SAS: proc format; value agegrp low - 12 = 'Pre Teen' 13 -15 = 'Teen' 16 - high = 'Driver'; run; libname test 'Z:ConsultingSAS Prog

Categories : Csv

Google Script Editor - Import multiple Csv files as multiple spreadsheets
For this you can loop the same code for all files. You have to make changes in this following line: function convertRangeToCsvFile_(csvFileName) { // Get the selected range in the spreadsheet var ws = SpreadsheetApp.getActiveSpreadsheet().getActiveSelection(); to get the range of each sheet by name. Also save the filenames for the csv files and loop through them. Hope that helps!

Categories : Csv




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.