hi5 / csv Goto Github PK
View Code? Open in Web Editor NEWCSV - AutoHotkey library for working with CSV Files
Home Page: https://autohotkey.com/boards/viewtopic.php?f=6&t=34853
CSV - AutoHotkey library for working with CSV Files
Home Page: https://autohotkey.com/boards/viewtopic.php?f=6&t=34853
In my case I have a CSV with 97 columns and 2740 rows.
I need to delete columns:
3 ,4 ,5 ,6 ,7 ,8 ,9 ,
11,12,13,14,15,16,17,
19,20,...
And I need to delete rows greater than 31
I.E. Deleting 99% of the original CSV. With the current process of deleting 1 row at a time this is pretty slow.
Deleting all rows > 31, in this case is simple! %CSV_Identifier%CSV_TotalRows := numRows
.
Deleting the columns however is a little more tricky.
I'm envisaging:
CSV_DeleteRows(identifier,greaterThanID,lessThanID){...}
CSV_DeleteColumns(identifier,greaterThanID,lessThanID){...}
or perhaps better still:
CSV_DeleteRows(identifier,[[greaterThanID,lessThanID],[greaterThanID2,lessThanID2],...]){...}
CSV_DeleteColumns(identifier,[[greaterThanID,lessThanID],[greaterThanID2,lessThanID2],...]){...}
Thoughts?
I don't see option like this, and it seems like Load
ing another file over the same Identifier just appends to already existing data.
I am a beginner to Autohotkey and I though this library would help me complete what I wanted to do. Currently, I am just reading in a tsv file (tab separated value file). The file seams to load. When I output the headers, the message box is missing the last column.
#include csv.ahk
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
csv_filename := "timecard2.txt"
FormatTime, CurrentYear,, yyyy
FormatTime, CurrentMonthDay,, MM-dd
FormatTime, CurrentWeekday,, ddd
FormatTime, CurrentTime,, hh:mm
Week := SubStr(A_YWeek, -1)
CSV_Load(csv_filename,CSV,"`t")
row := CSV_ReadRow(CSV,1)
Msgbox %row%
Date Clock-In Clock-Out
2022-45-11-07-Mon 07:21 04:37
2022-45-11-08-Tue 07:05 04:19
2022-45-11-09-Wed 07:07 04:13
2022-45-11-10-Thu 07:04 04:02
2022-45-11-11-Fri 07:07
HI, just to start, this CSV library is great and does a lot of good things.
I think I found an issue when you try to use CSV_Load on two different .csv files in one .ahk program.
The second call of CSV_Load, the CSV_Identifier overwrites the first CSV_Identifier.
You can still access the data members of the second CSV_Identifier but use the first CSV_Identifier.
EX
CSV_Load("\Job Folder\jobFolderPaths.csv", JobFolderPathData,",") -> JobFolderPathData is the 1st CSV_Identifier
CSV_Load("\Job Folder\JobListPath.csv", CompanyIndex ,",") -> CompanyIndex is the 2nd CSV_Identifier
If you call CSV_FileName(JobFolderPathData) (1st CSV_Identifier) you will return the file name of CompanyIndex (1st CSV_Identifier)
This issue persists even if each CSV_Load() is in it's own .ahk file.
Thanks
EB
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.