Questions tagged [txt]

txt is the conventional filename extension of text files.

1467 questions
2
votes
1 answer

Reading a .txt file in WSO2 Integration Studio

Is it possible to read a .txt file which has "|" as seperator using smooks? The file is similar to a normal csv file, only the extension is .txt. For csv we make use of "csv-reader", what can I use for reading a .txt file? Or is there any way to…
Ruby
  • 368
  • 1
  • 9
2
votes
1 answer

How to load txt file that used indentations to mark observations into R

I am running analyses with data by county, and I would like to include variables with data from adjacent county. Before that, I need a file listing each county's adjacent counties. From the census, I have such a txt file, but the format is...…
2
votes
1 answer

Reading a text file accurately in Python

I am trying to read a .txt file. However, the output is in strings and I don't get the actual array. I present the current and expected outputs below. import numpy as np with open('Test.txt') as f: A = f.readlines() print(A) The current…
user19862793
  • 169
  • 6
2
votes
1 answer

Get Text From Image in python

How do I get the text from a image? Can somebody help? I am using a MacBook. I searched a bunch of things, but those were for Windows users.
2
votes
0 answers

Find the occurrence of a particular word from a file in python

I have a text file which contains some lines as follows input text guildenstern32_7 Nay, good my lord, this courtesy is **not** of the right breed. If it shall please you to make me a wholesome answer, I will do your mother's…
RBS123
  • 47
  • 3
2
votes
1 answer

Using Python, how to extract text and images from PDF + color strings and numbers from the output txt file

Using Python, I would like to extract text from a PDF into a txt file (done) color all numbers and specific strings of the txt file like this example…
CelloRibeiro
  • 160
  • 11
2
votes
1 answer

Read txt file to pandas df with specific lineterminator (row) symbol

I have a huge txt file (over 90 000 lines) that I want to read as a single column in a pandas df and I have a specific symbol to mark the end of each line / row i.d. ‡. So far, I have tried : df = pd.read_csv(fic, sep='\t', lineterminator='‡',…
Marrluxia
  • 61
  • 1
  • 9
2
votes
1 answer

Creating a txt file from strings in a column R

I have this table Column A Column B Column C Column D A x 1 k1 B k 2 k2 C z 3 k3 D y 4 k4 I would like to print a txt file containing all the string in column A, divided by comma. Output: txt file --> A,B,C,D df1 <-…
2
votes
3 answers

Concatenate multiple txt files with a name of file as a first column

I would like to concatenate multiple .txt files in one single file, putting also the file name as the first column before each file (in order to understand from which file the data comes from). The code I am using below does this, but only for the…
user3224522
  • 1,119
  • 8
  • 19
2
votes
1 answer

How to pass information from txt to excel by vba

I need a favor here i have a code that i need to transcript a txt file to excel without losing information and spliting it by a "-". the vba is generating an error call 53 where it says that the file cant be found but thats the right direction of…
2
votes
2 answers

Writing to text file while reading one. (ValueError: I/O operation on closed file.)

I'm currently working on a script that rearranges JSON data in a more basic manner so I can run it through another YOLO box plot script. So far I've managed to make the script print the data in the exact format that I wish for. However, I would like…
Baowz
  • 23
  • 4
2
votes
1 answer

Magic 8 ball txt file list

I need my random responses to be the sentences or strings I have stored in my txt file. It only prints out a single word instead of the whole line, how can I fix this, thanks. import random import time question = input("Ask the magic 8 ball a…
Sielko
  • 43
  • 6
2
votes
1 answer

Modify Array Based on User Input

For my assignment, we are currently coding a hotel booking system. For each room booked I want to make it so that a room that was previously available when selected is eliminated from the array. This is my array: availableRooms[38, 48, 64, 89, 110,…
bradmate
  • 41
  • 1
2
votes
3 answers

How to zip a file in python?

I have been trying to make a python script to zip a file with the zipfile module. Although the text file is made into a zip file, It doesn't seem to be compressing it; testtext.txt is 1024KB whilst testtext.zip (The code's creation) is also equal to…
2
votes
1 answer

How to inset dash between regex match?

I need to add - in between of regex match in text file. I tried this but no luck! -L\d{1,2} # this match all I need Sa-L1 Sa-L23 Desire output: Sa-L-1 Sa-L-23 There are -L in the lines, but I want to change -L with digits.
izoysh
  • 21
  • 1
1 2
3
97 98