Questions tagged [txt]

txt is the conventional filename extension of text files.

1467 questions
1
vote
0 answers

Extracted title and abstract from txt file to excel but some of the abstracts do not match the titles

I had more than 1500 entries of in txt format.The following picture shows an example of such an entry: An example of one entry. Every entry has a title and abstract. I wanted to extract the title ('TI -') and corresponding abstract ('AB -') of…
Apples
  • 29
  • 5
1
vote
3 answers

awk BEGIN insert new column to .txt without overwriting existing file data, include new column header and convert to csv

I have a file vols.txt like this: LabelID Mean StdD Max Min Count Vol(mm^3) Extent(Vox) 0 0.00000 0.00000 0.00000 0.00000 14121856 2973312.714 512 512 54 1 …
1
vote
1 answer

Get the length of multiple txt files based on sorted filenames in python

I want to get the length of each txt file in a folder. The files are all in txt format and are all in the same directory. The name of the txt files beginning with date Mon year format and followed with news titles such as upper case and lower case…
Maibaozi
  • 47
  • 8
1
vote
2 answers

AWK populating an empty column with AWK and Sed is not working

I have the following file called stack1.txt: Date Item Amount 2020-01-23 Petrol -160 2020-03-24 Electricity -200 2020-04-24 Electricity -200 2020-05-30 Trim line -50 …
Christian Hick
  • 401
  • 3
  • 10
1
vote
4 answers

How to temporarily create a text file without any file location and send as a response in spring boot at run time?

Need to create a txt file by the available data and then need to send the file as rest response. the app is deployed in container. i dont want to store it in any location on container or any location in spring boot resources. is there any way where…
tomsheldon
  • 49
  • 1
  • 6
1
vote
1 answer

Add a new line with predefined data after each string in a txt document

This is how my txt document look like (an example); asdf 1234 qwert 56789 zzzzz ccccc I want to add "STRING" in front each input, and a new line with "ENTER" after every input. This is HOW I WANT it to look like; STRING asdf ENTER STRING…
alexxx033
  • 13
  • 3
1
vote
1 answer

I would like to put a text file in existing excel file on specific cell using python

I would like to put text file(calculation log - not not in tabular form) in existing excel file on specific cell. import pandas as pd log=open('path') writer = pd.ExcelWriter('existing excel file', engine='xlsxwriter') log.to_excel(writer ,…
Soo
  • 35
  • 4
1
vote
2 answers

Merge all txt files in dataframe pandas

I have a series of txt files in a folder and I wanted to move these files to a data frame but I only managed to do this by saving a csv file, how do I work with the data frame directly without having to save to a csv file? follow my code…
Eric Alves
  • 101
  • 1
  • 8
1
vote
5 answers

read the elements of a text in python

I have a text file like this: there is no separation mark. When I use these lines of code, it returns nothing: with open('input.txt','r') as f: contents = f.read() print(contents) How can I save its elements in a python list or array?
Mitra
  • 157
  • 2
  • 12
1
vote
1 answer

Connecting a proxy to a Python script using the Telethon module

I need to get the proxy from the proxy.txt file: ip:port:username:password and add to the code: file = dbm_base() api_id = int(file['api_id4'].decode()) api_hash = file['api_hash4'].decode() client = TelegramClient('client4', api_id, api_hash,…
1
vote
0 answers

txt to excel and excel to txt maintain formatting VBA

this is how I convert txt to excel and convert back excel to txt. I want to put all the things in column A in excel and need to maintain the format. the format seems okay when txt convert to excel. but when I change it back to txt, some of the line…
Natashah
  • 9
  • 1
1
vote
1 answer

Transform a txt file to a pandas dataframe

hi I have the following txt file December line: 285 - event ID: 67511 line: 296 - event ID: 67512 November line: 305 - event ID: 67515 line: 300 - event ID: 67517 I want to transform it into the following data frame df1 = pd.DataFrame( { …
xavi
  • 80
  • 1
  • 12
1
vote
2 answers

Issues with splitting txt file (1 billion rows) into chunks (1.5 mil rows each), unable to figure how to write the remaining rows to last file

I'm learning how to operate with files and decided to go big. Generated 30 GB file of random text using small dictionary, file consists of 1 billion rows, every row is 2 strings delimited by space. My specs: Ryzen 3600, 16gb 3200 RAM, 512 GB…
1
vote
3 answers

How to read last inserted lines in a txt file with C#?

My goal is to read the last inserted lines from a txt file and show only newly inserted lines in the console. Here is my code- class Program { static void Main(string[] args) { string path = @"D:\tmp"; …
1
vote
1 answer

Creating table from txt with delimiter

At the moment I'm trying to automate the process of creating excel files from SAP tables. We always import a total of 50 different tables from the SAP system in the form of a txt file with the delimiter '|'. Unfortunately in some tables this…