0

Hope my first post is relevant enough. I'm a newbie coder and this is as much a learning exercise as it is a favor for my girlfriend. She has test results from a device that outputs data to .csv in multiple (100+) files. the important data is the separate file names and one column of data. so we want:

Input -
File1.csv
data1 data2 data3
12341 23534 3454
32453 3454 4345

File2.csv
data1 data2 data3
35123 23456 5654
34234 7578 67854

Output -
Ouputfile.csv
"File1.csv"
data2
23534
3454
"File2.csv"
data2
23456
7578

*note, sorting would be bad. we don't want to sort. order in files is important*

I have gotten a wonderful little bash script to get this to work:

#!/bin/bash

fileList=`ls inputdatafolder/`
for var in $fileList
do
	echo $var >> outputfolder/outputfile.csv
	cat testdata/$var | cut -d, -f2 >> outputfolder/outputfile.csv
done

The problem now is the workstation is (of course) Windows. So the question now is, what do I port this to so that it works on her environment?

Obvious answer is "install cygwin" but being a corporate machine that is/may not be, an option. Same goes for perl or python. Java may be possible as it is most common. I tried Batch for a short while and got no where useful even with Google's help. C++ seems like overkill but I have resources to go that route. Just no experience.

This seems like a common issue online but no one has a solid solution for such a restricted environment. A pointer in the right direction should be enough. I'll respond with my own solution(s) as I think of ideas.

Thanks
Griffman99h

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by L7Sqr
0

Perhaps the for will work for you. That link has an example of how to split up the output of the ping command.

Edited by mike_2000_17: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.