Skip to content

Commit f27d20e

Browse files
#98 : csv file viewer in console changes
1 parent 1d41bc5 commit f27d20e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/commands/showfile.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default class ShowFile extends Command {
4343
private showFile(args: any) {
4444

4545
let data = Utilities.getStringFromFile(this, args.file)
46+
4647
let rows = data.split('\n')
4748

4849
let widthArray = []
@@ -53,6 +54,10 @@ export default class ShowFile extends Command {
5354
widthArray[i] = 0
5455
}
5556

57+
if(recordsToShow > rows.length){
58+
recordsToShow = rows.length
59+
}
60+
5661
for(let i = 0; i < recordsToShow; i++){
5762
let row = rows[i].split(",");
5863
let s = ''

0 commit comments

Comments
 (0)