Jump to content

Can auto it do it?


Recommended Posts

I posted this in the GUI section, but maybe this is where I should post it.

Well I am looking to do the following. In a specific .csv file I want to sort out two specific types of data. One particular column has either XX or YY in the cells. My boss wants me to sort them out, so that we get totals for XX and YY in a report. The .CSV appends data to it through the day and that was done with the autoit and the help of BigDod or was it BidDod? . Anyway this would be easy to do within the file, but the users can't have access to manipulate data, so I have to find another method. I am working with the file to see if can put sometype of protection within the worksheet that would allow them to sort and get the totals they are looking for, but not edit the cells. I haven't had to much luck with that idea and my boss probably won't go for it. So before I go work on it somemore I wanted to ask the autoit pros. If autoit could search for all the ROWS that have XX in the first column and import it into something else and the same for all the ROWS that have YY and provide totals for each than my task would be done. I've used autoit on a few other tasks for this project that I am on and it has worked out perfectly. I don't expect Autoit to do everything and if can't do this task I still believe its a powerful software. If it could help me with this task that would just be like have an early Christmas or something.

cliff note: import specific data from a .csv file into some type of grid that cannot be edited by users

Link to comment
Share on other sites

Are you using Excel? If you are then Excel can do it pretty easily. Look into pivot tables.

Edited by Fossil Rock

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Link to comment
Share on other sites

someone gave me a script and i edited for my needs. this is what i have.

Global $PI_count = 0, $PO_count = 0

$file = FileOpen('GLDAILY.CSV', 0)

$file2 = FileOpen('gldailyPI.csv',1)

$file3 = FileOpen('gldailyPO.csv',1)

; Check if file opened for reading OK

If $file = -1 Then

MsgBox(0, "Error", "Unable to READ file.")

Exit

EndIf

; Read in lines of text until the EOF is reached

While 1

$line = FileReadLine($file)

If @error = -1 Then ExitLoop

$data = StringSplit($line, ",")

If $data[2] = "PI" Then

$PI_count = $PI_count + $data[7]

FileWriteLine($file2,$line)

Else; It's assumed that $data[2] = "PO"

$PO_count = $PO_count + $data[7]

FileWriteLine($file3,$line)

EndIf

Wend

;MsgBox(0x1000,"Output", "PI SUM is " & $PI_count)

;MsgBox(0x1000,"Output", "PO SUM is " & $PO_count)

FileClose($file)

FileClose($file2)

FileClose($file3)

;Can I use FileClose($file,file2,$file3) instead?

I will have to make more changes to it b/c my boss wants only one file. She doesn't want two files, but at least I know autoit can do it now.

Link to comment
Share on other sites

  • Moderators

Pick a thread man... double posting is confusing!: http://www.autoitscript.com/forum/index.php?showtopic=22707

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

therein lies the joke... but i think we really have been seeing alot more redundancy than usual the last couple of weeks.

The forum keeps growing at an incredible rate. Over 3000 users on the forum this morning, thats going to put a huge load on the database. So when the forum doesn't respond right away they click the button again.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...